#include <composite_pattern.h>

Employee::Employee(string name, string dept, int sal)
{
    this->name = name;
    this->dept = dept;
    this->salary = sal;
}

void Employee::add(Employee *e)
{
    this->subordinates.push_back(e);
}

void Employee::remove(Employee *e)
{
    this->subordinates.remove(e);
}

list<Employee*> Employee::getSubordinates()
{
    return this->subordinates;
}

string Employee::toString()
{
    return "Employee :[ Name : " + name + ", dept : " + dept + ", salary : " + to_string(salary) + " ]";
}
